Some types of advanced high-speed input/output (I/O) devices, such as network interface controllers (NICs), permit applications running on a host processor to interact directly with the functions of the I/O device, without kernel calls to the host operating system. Such I/O devices may support multiple service instances, which are allocated to client processes, such as host applications. The client processes submit work requests, typically by writing descriptors of the requests to respective queues in the host memory, which are then read and executed by the I/O device. The I/O device is responsible for allocating its resources to the different service instances while ensuring that the work requests in each queue are executed in the proper order.
U.S. Pat. No. 6,735,642, whose disclosure is incorporated herein by reference, describes methods for interaction between application programs and a DMA engine. In order to initiate a chain of DMA data transfers, an application program running on a CPU prepares the appropriate chain of descriptors in a memory accessible to the DMA engine. The application then sends a service order to the DMA engine indicating the memory address of the first descriptor in the chain, which is a request to the DMA engine to start execution of the descriptors. The application typically writes the service order to the “doorbell” of the DMA engine—a control register with a certain bus address that is specified for this purpose. Sending such a message to initiate DMA execution is known as “ringing the doorbell” of the DMA engine.
The DMA engine responds by reading and executing the first descriptor. It then updates a status field of the descriptor to indicate to the application that the descriptor has been executed. The engine follows the “next” field through the entire linked list, marking each descriptor as executed, until it reaches a null pointer in the last descriptor. After executing the last descriptor, the DMA engine is ready to receive a new list for execution. The DMA doorbell may be rung multiple times without loss of data and without executing the same descriptor multiple times.
U.S. Pat. No. 7,653,754, whose disclosure is incorporated herein by reference, describes a method for preventing deadlock in communication between a host software application and a NIC without requiring either separate write and read paths or synchronization between users. The method comprises writing a doorbell associated with at least one descriptor having a descriptor context to a buffer in the NIC, dropping at least one doorbell from the buffer if the buffer is full, thereby allowing a write of a new doorbell to the buffer, and recovering each dropped doorbell for further execution of descriptors associated with this doorbell. The descriptor execution is in order of posting by the application to the NIC.